<template>
    <div id="OrdersTitle">
        <v-details :inputConfig="inputConfig" :detailData="inputData" :rules="rules"></v-details>
    </div>
</template>

<script>
    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        props: {
            inputData: {
                type: Object,
            }
        },
        mixins: [baseMixin],
        name: "OrdersTitle",
        data() {
            return {
                rules: {
                    cost_code: [
                        {required: true, trigger: 'blur'},
                    ],
                    facility_id: [
                        {required: true, trigger: 'blur'},
                    ],
                    cost_date: [
                        {required: true, trigger: 'blur'},
                    ],
                    cost_amt: [
                        {required: true, trigger: 'blur'},
                    ],
                    cost_curr_code: [
                        {required: true, trigger: 'blur'},
                    ],
                    cost_level: [
                        {required: true, trigger: 'blur'},
                    ],
                    cost_alloc: [
                        {required: true, trigger: 'blur'},
                    ]
                },
                addflag: true
            }
        },
        computed: {
            inputConfig() {
                return [
                    [
                        {
                            type: "select",
                            label: "成本",
                            props: "cost_code",
                            options: this.getOptions("getSelectCode/COST_CODE/COST_DESC/BIC_COST_CODE/1=1")
                        },
                        {
                            type: "select",
                            label: this.$t('bill.wareHouse'),
                            props: "facility_id",
                            options: this.getOptions("getSelectCode/FACILITY_ID/NAME/BIC_FACILITY/1=1")
                        },
                        {
                            type: "select",
                            label: this.$t('bill.customer'),
                            props: "cust_code",
                            options: this.getOptions("getSelectCode/CUST_CODE/NAME/BIC_CUSTOMER/1=1")
                        },
                        {
                            type: "select",
                            label: "货品组",
                            props: "item_group",
                            options: this.getOptions("getSelectCode/ITEM_GROUP/ITEM_GROUP_DESC/BIC_ITEM_GROUP/1=1")
                        },
                    ],
                    [
                        {
                            type: "date",
                            label: this.$t('common.date'),
                            props: "cost_date",
                        },
                        {
                            type: "input",
                            label: "金额",
                            props: "cost_amt",
                        },
                        {
                            type: "select",
                            label: "货币",
                            props: "cost_curr_code",
                            options: this.getOptions("getSelectCode/CURR_CODE/CURR_DESC/BIC_CURRENCY/1=1")
                        },
                    ],
                    [
                        {
                            type: "select",
                            label: this.$t('security.tier'),
                            props: "cost_level",
                            options: this.getOptions("getSelectCode/COST_LEVEL/LEVEL_DESC/BIC_CODE_COSTLVL/language='zh'")
                        },
                        {
                            type: "select",
                            label: this.$t('out.allocation'),
                            props: "cost_alloc",
                            options: this.getOptions("getSelectCode/COST_ALLOC/ALLOC_DESC/BIC_CODE_COSTALLOC/language='zh'")
                        },
                        {
                            type: "input",
                            label: "计费基准",
                            props: "total_basis",
                        },
                    ],
                    [
                        {
                            type: "select",
                            label: "期段",
                            props: "cost_period",
                            options: this.getOptions("getSelectCode/PERIOD_CODE/PERIOD_DESC/BIC_PERIOD/1=1")
                        },
                        {
                            type: "date",
                            label: "自日期",
                            props: "from_date",
                        },
                        {
                            type: "date",
                            label: "至日期",
                            props: "to_date",
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: "成本号",
                            props: "cost_no",
                            disabled: true
                        },
                    ]
                ]
            }
        },
        methods: {},
        mounted() {

        },
        watch: {

        },
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>
